package online.shenme.day10;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;

public class FileTest {
    public static void main(String[] args)  {
        try {
            File file = new File("C:\\Users\\Johnzz\\Desktop");
            file.mkdirs();
          new File(file,"a.txt").createNewFile();
            System.out.println(file.isFile());
            System.out.println(file.isDirectory());
            System.out.println(file.getName());
            System.out.println(file.delete());
            Arrays.stream(file.listFiles()).toList().forEach(s-> System.out.println(s));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
